<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增标签')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-dict-add">
			<div class="form-group">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-3 control-label is-required">栏目：</label>
						<div class="col-xs-8">
							<select id="column" class="form-control select2-multiple"  required>
								<option value="">请选择栏目</option>
								<option th:each="col : ${cols}" th:value="${col.code}" th:text="${col.name}" ></option>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">标签名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="tagName" id="tagName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script type="text/javascript">
		var prefix = ctx + "system/tag";

		
		function submitHandler() {
	        if ($.validate.form()) {
	            var data = $("#form-dict-add").serializeArray();
	            var column = $.form.selectSelects("column");
	            data.push({"name": "cloumnCode", "value": column});
	            var type = $.form.selectSelects("type");
	            data.push({"name": "type", "value": type});
	        	$.operate.save(prefix + "/add", data);
	        }
	    }

	</script>
</body>
</html>
